///////////////////////////////////////////////////////////////////////////////////////////////////
/// \file formic/fqmc/diis.h
///
/// \brief   header file for the DIIS update class
///
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef FORMIC_FQMC_DIIS_HEADER
#define FORMIC_FQMC_DIIS_HEADER

#include<vector>

#include<boost/shared_ptr.hpp>

#include<formic/random/random.h>

namespace formic {

  class InputBase;
  class Configuration;
  template<class S> class CoeffObj;

  namespace fqmc {

    template<class S> class Sampler;

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /// \brief  A class to perform a DIIS update of the current wave function
    ///
    ///////////////////////////////////////////////////////////////////////////////////////////////////
    template <class S> class DIISUpdater {

      private:

      public:

        DIISUpdater(const formic::InputBase & userinp);

        bool update(const formic::InputBase & userinp,
                    const std::vector<boost::shared_ptr<std::vector<double> > > & pmtr_hist,
                    const std::vector<boost::shared_ptr<std::vector<double> > > & grad_hist,
                    boost::shared_ptr<formic::fqmc::Sampler<S> > & sampler,
                    const boost::shared_ptr<formic::CoeffObj<S> > & co);

    };

  }

}

#endif
